package GameOntology;

import java.util.Random;

public class ComputerPlayer extends Tank {

    private String direction;
    private final String []directionAll = {"up","down","right","left"};
    private final boolean []isOrNo = {true,false};
    Random ra = new Random();

    public ComputerPlayer() {
    }

    public ComputerPlayer(String img, int x, int y, String tankUp,
                          String tankLeft, String tankRight, String tankDown, GameWindow gameWindow) {
        super(img, x, y, tankUp, tankLeft, tankRight, tankDown, gameWindow);
        this.setBulletImg("game\\img\\bullet_enemy.png");
        this.setTeam("computer");
    }

    public String getDirection() {
        return direction;
    }

    public void randomMove_argument(){
        boolean []rM = {true,false,true,true};
        direction=directionAll[ra.nextInt(4)];
        this.setMove(rM[ra.nextInt(4)]);
    }

    public void randomMove(){
        this.move(this.direction,this.isMove());
    }
    public void randomAttack(){
        this.setAttack(isOrNo[ra.nextInt(2)]);
        this.attack();
    }
}
